package com.ipinyou.hb2redis;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Day {

	public static void main(String[] args) throws ParseException {
		long time = getTime();
		System.out.println(time);

		Date data = new Date(time);
		System.out.println(data.toLocaleString());
	}

	private static long getTime() throws ParseException {
		SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd");
		String day = sf.format(new Date());
		Date today = sf.parse(day);
		long time = today.getTime();
		return time;
	}

}
